<html>
<head><meta charset="utf-8"><title>meeting 2021-04-20 · project-const-generics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/index.html">project-const-generics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html">meeting 2021-04-20</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234697986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/234697986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#234697986">(Apr 15 2021 at 15:27)</a>:</h4>
<p>Hi <span class="user-group-mention" data-user-group-id="3805">@project-const-generics</span>, does one of you have something you want to discuss during the next meeting?</p>
<p>I think spending more time talking about issues wrt generic anon consts isn't too useful rn until I've made some progress on <a href="https://github.com/rust-lang/rust/issues/83086">#83086</a> which I am currently not spending any time on.</p>
<p>Another topic would be <a href="https://github.com/rust-lang/project-const-generics/issues/6">https://github.com/rust-lang/project-const-generics/issues/6</a>, which interacts with structural match. It would be good to both include wg-const-eval and to spend some time to figure out the current status. It's also not really needed until val trees is finished, which is also kind of blocked on me.</p>



<a name="235069446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235069446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235069446">(Apr 18 2021 at 12:44)</a>:</h4>
<p>we could talk about const param defaults wf</p>



<a name="235069522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235069522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235069522">(Apr 18 2021 at 12:45)</a>:</h4>
<p>so if we want to check the well formedness of const param defaults, even if they are generic</p>



<a name="235072640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235072640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235072640">(Apr 18 2021 at 13:35)</a>:</h4>
<p>also how to deal with anon consts in parameter listings <a href="https://github.com/rust-lang/rust/issues/84299">#84299</a></p>



<a name="235076236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235076236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235076236">(Apr 18 2021 at 14:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235072640">said</a>:</p>
<blockquote>
<p>also how to deal with anon consts in parameter listings <a href="https://github.com/rust-lang/rust/issues/84299">#84299</a></p>
</blockquote>
<p>or nm, that might just work™</p>



<a name="235355784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235355784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235355784">(Apr 20 2021 at 14:48)</a>:</h4>
<p>hey ho hey, i don't really have much to say today</p>



<a name="235355815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235355815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235355815">(Apr 20 2021 at 14:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235069446">said</a>:</p>
<blockquote>
<p>we could talk about const param defaults wf</p>
</blockquote>
<p>i looked a bit more at how this works</p>



<a name="235355869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235355869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235355869">(Apr 20 2021 at 14:49)</a>:</h4>
<p>and it seems like there isn't much need to talk about this</p>



<a name="235355888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235355888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235355888">(Apr 20 2021 at 14:49)</a>:</h4>
<p>wave</p>



<a name="235355927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235355927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235355927">(Apr 20 2021 at 14:49)</a>:</h4>
<p>sorry i'm late</p>



<a name="235356043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356043">(Apr 20 2021 at 14:50)</a>:</h4>
<p>so for</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="n">concrete_expr</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="235356106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356106">(Apr 20 2021 at 14:50)</a>:</h4>
<p>it seems clear to me that we want to eagerly check that <code>concrete_expr</code> is wf</p>



<a name="235356228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356228">(Apr 20 2021 at 14:51)</a>:</h4>
<p>that's not 100% clear to me</p>



<a name="235356248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356248">(Apr 20 2021 at 14:51)</a>:</h4>
<p>we don't necessarily do that for type defaults, for example</p>



<a name="235356254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356254">(Apr 20 2021 at 14:51)</a>:</h4>
<p>we do</p>



<a name="235356262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356262">(Apr 20 2021 at 14:51)</a>:</h4>
<p>if it's fully concrete</p>



<a name="235356265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356265">(Apr 20 2021 at 14:51)</a>:</h4>
<p>doch?</p>



<a name="235356278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356278">(Apr 20 2021 at 14:51)</a>:</h4>
<p>hmm</p>



<a name="235356298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356298">(Apr 20 2021 at 14:52)</a>:</h4>
<p>what does "doch" mean</p>



<a name="235356341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356341">(Apr 20 2021 at 14:52)</a>:</h4>
<p>we don't check <code>Vec&lt;[T]&gt;</code> for example</p>



<a name="235356374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356374">(Apr 20 2021 at 14:52)</a>:</h4>
<p>but do error for <code>Vec&lt;[i32]&gt;</code></p>



<a name="235356379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356379">(Apr 20 2021 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235356298">said</a>:</p>
<blockquote>
<p>what does "doch" mean</p>
</blockquote>
<p>I'll let some actual German speaker answer that ;)</p>



<a name="235356392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356392">(Apr 20 2021 at 14:52)</a>:</h4>
<p>oh lol</p>



<a name="235356394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356394">(Apr 20 2021 at 14:52)</a>:</h4>
<p>it means roughly "we do not!"</p>



<a name="235356464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356464">(Apr 20 2021 at 14:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235356374">said</a>:</p>
<blockquote>
<p>but do error for <code>Vec&lt;[i32]&gt;</code></p>
</blockquote>
<p>ok, I sort of remember this, I'm not sure I'm happy about it though because of the inconsistency</p>



<a name="235356479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356479">(Apr 20 2021 at 14:53)</a>:</h4>
<p>there are reasonable reasons not to do it</p>



<a name="235356588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356588">(Apr 20 2021 at 14:53)</a>:</h4>
<p>well anyway</p>



<a name="235356601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356601">(Apr 20 2021 at 14:53)</a>:</h4>
<p>it's (probably) a relatively minor point</p>



<a name="235356786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356786">(Apr 20 2021 at 14:55)</a>:</h4>
<p>so <code>struct Foo&lt;const N: usize = 0 - 1&gt;</code> should err eagerly, do you agree <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="235356810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356810">(Apr 20 2021 at 14:55)</a>:</h4>
<p>I believe it should at least warn</p>



<a name="235356852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356852">(Apr 20 2021 at 14:55)</a>:</h4>
<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="235356904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356904">(Apr 20 2021 at 14:55)</a>:</h4>
<p>it seems like a minor point -- whatever challenges arise for errors surely also arise for warnings</p>



<a name="235356988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356988">(Apr 20 2021 at 14:56)</a>:</h4>
<p>there are no <em>implementation</em> challenges here</p>



<a name="235356997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235356997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235356997">(Apr 20 2021 at 14:56)</a>:</h4>
<p>for errors</p>



<a name="235357017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357017">(Apr 20 2021 at 14:56)</a>:</h4>
<p>implemented this in <a href="https://github.com/rust-lang/rust/issues/84299">#84299</a></p>



<a name="235357151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357151">(Apr 20 2021 at 14:57)</a>:</h4>
<p>(that i know of ^^)</p>



<a name="235357230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357230">(Apr 20 2021 at 14:57)</a>:</h4>
<p>ok, so was this only a question of policy?</p>



<a name="235357265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357265">(Apr 20 2021 at 14:57)</a>:</h4>
<p>i want to stabilize both the relaxed parameter ordering <code>struct Foo&lt;const N: usize, T&gt;</code> and const parameter defaults fairly soon</p>



<a name="235357273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357273">(Apr 20 2021 at 14:57)</a>:</h4>
<p>I think we should have a consistent policy across types and constants</p>



<a name="235357281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357281">(Apr 20 2021 at 14:58)</a>:</h4>
<p>so it's a design question</p>



<a name="235357304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357304">(Apr 20 2021 at 14:58)</a>:</h4>
<p>I generally think the policy should be consistent across all defaults</p>



<a name="235357337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357337">(Apr 20 2021 at 14:58)</a>:</h4>
<p>(which it's not today)</p>



<a name="235357338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357338">(Apr 20 2021 at 14:58)</a>:</h4>
<p>not an implementation issue</p>



<a name="235357416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357416">(Apr 20 2021 at 14:58)</a>:</h4>
<p>specifically, we draw this distinction between things that are fully known and things that involve generics; I'm not convinced that's a good idea for a hard error</p>



<a name="235357445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357445">(Apr 20 2021 at 14:58)</a>:</h4>
<p>however</p>



<a name="235357476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357476">(Apr 20 2021 at 14:59)</a>:</h4>
<p>I think there's an alternative version that is maybe good -- e.g., if we can prove that the default is never valid</p>



<a name="235357503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357503">(Apr 20 2021 at 14:59)</a>:</h4>
<p>which is likely true sometimes even when generics are involved</p>



<a name="235357535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357535">(Apr 20 2021 at 14:59)</a>:</h4>
<p>regardless I'm ok having it error to be consistent with types</p>



<a name="235357976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235357976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235357976">(Apr 20 2021 at 15:00)</a>:</h4>
<p>okay, the imo less clear cases are</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">First</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">M</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="n">N</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Second</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">]</span><span class="o">&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">);</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Third</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">M</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">N</span><span class="w">  </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">}</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="235358143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358143">(Apr 20 2021 at 15:01)</a>:</h4>
<p>the first and second  seem desirable to me</p>



<a name="235358180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358180">(Apr 20 2021 at 15:01)</a>:</h4>
<p>back up</p>



<a name="235358217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358217">(Apr 20 2021 at 15:01)</a>:</h4>
<p>errors are desirable?</p>



<a name="235358363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358363">(Apr 20 2021 at 15:02)</a>:</h4>
<p>ah '^^</p>



<a name="235358427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358427">(Apr 20 2021 at 15:02)</a>:</h4>
<p>it's desirable to allow the first two cases, so these should be allowed imo</p>



<a name="235358476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358476">(Apr 20 2021 at 15:02)</a>:</h4>
<p>the first two seem obviously good</p>



<a name="235358507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358507">(Apr 20 2021 at 15:02)</a>:</h4>
<p>the third also seems pretty clearly good to me</p>



<a name="235358544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358544">(Apr 20 2021 at 15:02)</a>:</h4>
<p>and is a good example of why this is not clear cut ;)</p>



<a name="235358552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358552">(Apr 20 2021 at 15:02)</a>:</h4>
<p>that's something i am not sure of</p>



<a name="235358601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358601">(Apr 20 2021 at 15:03)</a>:</h4>
<p>does the third one fall into const_evaluatable_checked territory?</p>



<a name="235358642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358642">(Apr 20 2021 at 15:03)</a>:</h4>
<p>kinda</p>



<a name="235358650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358650">(Apr 20 2021 at 15:03)</a>:</h4>
<p>but I guess we're starting to tread onto interesting territory about evaluatable and how much we can encapsulate const generics</p>



<a name="235358654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358654">(Apr 20 2021 at 15:03)</a>:</h4>
<p>or like</p>



<a name="235358693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358693">(Apr 20 2021 at 15:03)</a>:</h4>
<p>yes</p>



<a name="235358712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358712">(Apr 20 2021 at 15:03)</a>:</h4>
<p>I'd like to understand what the general thinking is here</p>



<a name="235358988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235358988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235358988">(Apr 20 2021 at 15:04)</a>:</h4>
<p>I have to say that this may be a case where monomorphization-time errors are reasonable</p>



<a name="235359032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235359032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235359032">(Apr 20 2021 at 15:04)</a>:</h4>
<p>but I'd like to know how much of a conversation there has been around it</p>



<a name="235359554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235359554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235359554">(Apr 20 2021 at 15:06)</a>:</h4>
<p>that's a hard question to answer <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="235359596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235359596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235359596">(Apr 20 2021 at 15:06)</a>:</h4>
<p>to only focus on the const param default case for now</p>



<a name="235359649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235359649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235359649">(Apr 20 2021 at 15:07)</a>:</h4>
<p>we have pretty much 3 possible ways to deal with this</p>



<a name="235359922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235359922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235359922">(Apr 20 2021 at 15:08)</a>:</h4>
<ul>
<li>we check whether <code>N + 1</code> is evaluatable eagerly, causing an error if there isn't a bound expressing <code>N + 1 is const evaluatable</code> on <code>Third</code></li>
</ul>



<a name="235360070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360070">(Apr 20 2021 at 15:08)</a>:</h4>
<ul>
<li>we check whether <code>N + 1</code> is evaluatable when using the default, so treat this like type param defaults</li>
</ul>



<a name="235360363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360363">(Apr 20 2021 at 15:10)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="n">U</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;</span><span class="p">[</span><span class="n">T</span><span class="p">]</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="n">U</span><span class="p">);</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// let x: Foo::&lt;T&gt;; // err</span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235360376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360376">(Apr 20 2021 at 15:10)</a>:</h4>
<p>The latter is basically what we do with types now</p>



<a name="235360426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360426">(Apr 20 2021 at 15:11)</a>:</h4>
<p>although I don't get your example</p>



<a name="235360453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360453">(Apr 20 2021 at 15:11)</a>:</h4>
<p>maybe there is a missing <code>?Sized</code> somewhere</p>



<a name="235360487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360487">(Apr 20 2021 at 15:11)</a>:</h4>
<p><code>Vec</code> requires its generic param to be sized</p>



<a name="235360492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360492">(Apr 20 2021 at 15:11)</a>:</h4>
<p>which <code>[T]</code> isn't</p>



<a name="235360564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360564">(Apr 20 2021 at 15:12)</a>:</h4>
<p>but we only check it when using <code>Foo</code> with that default, even if <code>T</code> is still generic then</p>



<a name="235360576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360576">(Apr 20 2021 at 15:12)</a>:</h4>
<p>oh, I missed the <code>[]</code></p>



<a name="235360650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360650">(Apr 20 2021 at 15:12)</a>:</h4>
<p>sure, so that's an example of what I meant by: we could conceivably error when we can chose that "there does not exist a T that makes <code>Vec&lt;[T]&gt;</code> well formed"</p>



<a name="235360660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360660">(Apr 20 2021 at 15:12)</a>:</h4>
<p>but I believe we don't today</p>



<a name="235360711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360711">(Apr 20 2021 at 15:13)</a>:</h4>
<p>our trait solver can't answer queries like that, for one thing</p>



<a name="235360733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360733">(Apr 20 2021 at 15:13)</a>:</h4>
<p>(chalk can)</p>



<a name="235360768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360768">(Apr 20 2021 at 15:13)</a>:</h4>
<p>but it also opens up a bunch of interesting questions</p>



<a name="235360781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360781">(Apr 20 2021 at 15:13)</a>:</h4>
<ul>
<li>don't require any assertions that generic const expressions are evaluatable, only causing an error when using a concrete N (usize::MAX) in this case</li>
</ul>



<a name="235360817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360817">(Apr 20 2021 at 15:13)</a>:</h4>
<p>i have to say that i'm leaning towards this final bullet;</p>



<a name="235360844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360844">(Apr 20 2021 at 15:13)</a>:</h4>
<p>but I think it makes sense to consider this somewhat holistically</p>



<a name="235360857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360857">(Apr 20 2021 at 15:14)</a>:</h4>
<p>I feel like it'd be a good RFC to start work on</p>



<a name="235360910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360910">(Apr 20 2021 at 15:14)</a>:</h4>
<p>and probably a good topic for a lang team design meeting</p>



<a name="235360991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235360991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235360991">(Apr 20 2021 at 15:14)</a>:</h4>
<p>i'm not convinced we can talk about type parameter defaults 100% in isolation, though they seem like the easier case, since you don't have questions of const fn encapsulating details of their bodies</p>



<a name="235361120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361120">(Apr 20 2021 at 15:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235360991">said</a>:</p>
<blockquote>
<p>i'm not convinced we can talk about type parameter defaults 100% in isolation, though they seem like the easier case, since you don't have questions of const fn encapsulating details of their bodies</p>
</blockquote>
<p>2 and 3 can't be discussed without considering the bigger picture i think</p>



<a name="235361363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361363">(Apr 20 2021 at 15:16)</a>:</h4>
<p>wait, "type parameter defaults"?</p>



<a name="235361502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361502">(Apr 20 2021 at 15:16)</a>:</h4>
<p>do you mean checking <code>Vec&lt;[T]&gt;</code>?</p>



<a name="235361945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361945">(Apr 20 2021 at 15:18)</a>:</h4>
<p>i personally prefer 2 i think</p>



<a name="235361955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361955">(Apr 20 2021 at 15:18)</a>:</h4>
<p>s/type parameter/generic parameter/</p>



<a name="235361983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235361983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235361983">(Apr 20 2021 at 15:18)</a>:</h4>
<p>while still unsure about how to treat 1</p>



<a name="235362035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362035">(Apr 20 2021 at 15:18)</a>:</h4>
<p>I'm not sure i understand the difference betewen 2 and 3</p>



<a name="235362136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362136">(Apr 20 2021 at 15:19)</a>:</h4>
<p>I thought there had already been agreement that 1 was the desirable method, in one of the various issues for const generics (a little difficult to find it now, as I'm on my phone).</p>



<a name="235362177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362177">(Apr 20 2021 at 15:19)</a>:</h4>
<p>maybe so, but that agreement didn't percolate to the lang team :)</p>



<a name="235362184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362184">(Apr 20 2021 at 15:19)</a>:</h4>
<p>or at least, not to me</p>



<a name="235362263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362263">(Apr 20 2021 at 15:20)</a>:</h4>
<p>I feel like 1 would be annoying in practice as all get out</p>



<a name="235362309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362309">(Apr 20 2021 at 15:20)</a>:</h4>
<p>not to mention that it's inconsistent with what we do for types</p>



<a name="235362359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362359">(Apr 20 2021 at 15:20)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">M</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">second</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">()</span><span class="w">  </span><span class="k">where</span><span class="w"> </span><span class="n">const_evaluatable</span><span class="p">(</span><span class="n">N</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span>: <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">N</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">third</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span>: <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">N</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235362366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362366">(Apr 20 2021 at 15:20)</a>:</h4>
<p>I guess I'd like to do a better job outlining what goals we are trying to defend</p>



<a name="235362406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362406">(Apr 20 2021 at 15:20)</a>:</h4>
<p>Okay, but then this feels like a much bigger decision that needs to involve all the relevant parties. Otherwise we're likely just going to re-cover old ground.</p>



<a name="235362425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362425">(Apr 20 2021 at 15:20)</a>:</h4>
<p>I think i'm basically opposed to <code>const_evaluatable</code> as a concept :)</p>



<a name="235362470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362470">(Apr 20 2021 at 15:21)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> did we talk about const parameter defaults or just const arguments in general?</p>



<a name="235362547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362547">(Apr 20 2021 at 15:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="121053">varkor</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235362406">said</a>:</p>
<blockquote>
<p>Okay, but then this feels like a much bigger decision that needs to involve all the relevant parties. Otherwise we're likely just going to re-cover old ground.</p>
</blockquote>
<p>I don't think we can reach a decision here or anywhere, it requires an RFC, but what we can do is start to create a doc that better articulates the design space and the tradeoffs involved</p>



<a name="235362583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362583">(Apr 20 2021 at 15:21)</a>:</h4>
<p>Just const arguments in general, but I'm not sure I understand the argument that they should work differently.</p>



<a name="235362618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362618">(Apr 20 2021 at 15:21)</a>:</h4>
<p>what I actually want is a const generics vision doc lol :)</p>



<a name="235362816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362816">(Apr 20 2021 at 15:22)</a>:</h4>
<p>which issue was it, <span class="user-mention" data-user-id="121053">@varkor</span> ?</p>



<a name="235362838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362838">(Apr 20 2021 at 15:23)</a>:</h4>
<p>Let me try to find it.</p>



<a name="235362936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235362936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235362936">(Apr 20 2021 at 15:23)</a>:</h4>
<p>i do have an imo fairly good argument which goes from "we want generic const arguments" to "we want const evaluatable bounds"</p>



<a name="235363085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363085">(Apr 20 2021 at 15:24)</a>:</h4>
<p>now, do you want that in a vision doc or should i try to explain that now <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="235363113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363113">(Apr 20 2021 at 15:24)</a>:</h4>
<p>I think <a href="https://github.com/rust-lang/rust/issues/68436">https://github.com/rust-lang/rust/issues/68436</a> was the one I had in mind (and the referenced comments).</p>



<a name="235363169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363169">(Apr 20 2021 at 15:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235362936">said</a>:</p>
<blockquote>
<p>i do have an imo fairly good argument which goes from "we want generic const arguments" to "we want const evaluatable bounds"</p>
</blockquote>
<p>I'm happy to hear it now</p>



<a name="235363185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363185">(Apr 20 2021 at 15:25)</a>:</h4>
<p>the role of the vision doc is not really to make that argument</p>



<a name="235363217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363217">(Apr 20 2021 at 15:25)</a>:</h4>
<p>it's to show how const generics are going to look and feel in actual use</p>



<a name="235363227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363227">(Apr 20 2021 at 15:25)</a>:</h4>
<p>would removing const evaluatable bounds be a non-breaking change if we stabilised them and decided it was a bad decision Lol</p>



<a name="235363241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363241">(Apr 20 2021 at 15:25)</a>:</h4>
<p>this is the core of my concern about <code>const_evaluatable</code></p>



<a name="235363257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363257">(Apr 20 2021 at 15:25)</a>:</h4>
<blockquote>
<p>we want generic const arguments</p>
</blockquote>
<p>i assume that we all agree here <span aria-label="sparkles" class="emoji emoji-2728" role="img" title="sparkles">:sparkles:</span></p>



<a name="235363368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363368">(Apr 20 2021 at 15:26)</a>:</h4>
<p>does this just mean generic parameters like <code>const N: usize</code> ?</p>



<a name="235363384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363384">(Apr 20 2021 at 15:26)</a>:</h4>
<p>if so, I'm willing to accept that as a core axiom :)</p>



<a name="235363412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363412">(Apr 20 2021 at 15:26)</a>:</h4>
<p>generic const arguments are <code>foo&lt;{ N  + 1 }&gt;</code></p>



<a name="235363478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363478">(Apr 20 2021 at 15:26)</a>:</h4>
<p>so generic arguments which are more than just const parameters <code>N</code></p>



<a name="235363483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363483">(Apr 20 2021 at 15:26)</a>:</h4>
<p>I see, so, the ability to specify the value for const generic parameters in turbofish ?</p>



<a name="235363491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363491">(Apr 20 2021 at 15:27)</a>:</h4>
<p>ok, clearly yes</p>



<a name="235363558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363558">(Apr 20 2021 at 15:27)</a>:</h4>
<p>stuff like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="o">..</span><span class="p">.</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235363605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363605">(Apr 20 2021 at 15:27)</a>:</h4>
<p><code>N - 1</code> is currently not allowed as a const argument</p>



<a name="235363623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363623">(Apr 20 2021 at 15:27)</a>:</h4>
<p>OK. I think we want that, yes.</p>



<a name="235363714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363714">(Apr 20 2021 at 15:28)</a>:</h4>
<p>this means we need a way to unify generic constants</p>



<a name="235363745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363745">(Apr 20 2021 at 15:28)</a>:</h4>
<p>Say more</p>



<a name="235363848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363848">(Apr 20 2021 at 15:29)</a>:</h4>
<p>because otherwise using them will be incredibly painful</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">tail</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">(</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="n">tail</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235363850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363850">(Apr 20 2021 at 15:29)</a>:</h4>
<p>Do you mean we need the ability to infer <code>N</code> from knowing <code>N-1</code>?</p>



<a name="235363876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363876">(Apr 20 2021 at 15:29)</a>:</h4>
<p>we want this to typeck</p>



<a name="235363929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363929">(Apr 20 2021 at 15:29)</a>:</h4>
<p>ok</p>



<a name="235363933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363933">(Apr 20 2021 at 15:29)</a>:</h4>
<p>which means that both <code>N -  1</code> expressions have to be considered the same type</p>



<a name="235363936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363936">(Apr 20 2021 at 15:29)</a>:</h4>
<p>i.e., we want to be able to know that <code>N-1 = N-1</code> ?</p>



<a name="235363942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363942">(Apr 20 2021 at 15:29)</a>:</h4>
<p>even though they use a different const</p>



<a name="235363946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363946">(Apr 20 2021 at 15:29)</a>:</h4>
<p>yeah</p>



<a name="235363974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235363974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235363974">(Apr 20 2021 at 15:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235363933">said</a>:</p>
<blockquote>
<p>which means that both <code>N -  1</code> expressions have to be considered the same type</p>
</blockquote>
<p>not quite, right?</p>



<a name="235364030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364030">(Apr 20 2021 at 15:30)</a>:</h4>
<p>it means that we have to know that they evaluate to the same value</p>



<a name="235364089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364089">(Apr 20 2021 at 15:30)</a>:</h4>
<p>ok, I'm following so far</p>



<a name="235364143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364143">(Apr 20 2021 at 15:30)</a>:</h4>
<p><code>N - 1</code> isn't a type <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> we want to be able treat the types <code>[T; N - 1]</code> as equal</p>



<a name="235364213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364213">(Apr 20 2021 at 15:31)</a>:</h4>
<p>right</p>



<a name="235364248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364248">(Apr 20 2021 at 15:31)</a>:</h4>
<p>and to do that, we need to show that the two lengths will evaluate to the same value</p>



<a name="235364272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364272">(Apr 20 2021 at 15:31)</a>:</h4>
<p>yeah</p>



<a name="235364456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364456">(Apr 20 2021 at 15:32)</a>:</h4>
<p><code>const_evaluatable_checked</code> does this by building an abstract representation for the mir</p>



<a name="235364485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364485">(Apr 20 2021 at 15:32)</a>:</h4>
<p>something like this will probably be needed</p>



<a name="235364605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364605">(Apr 20 2021 at 15:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235364456">said</a>:</p>
<blockquote>
<p><code>const_evaluatable_checked</code> does this by building an abstract representation for the mir</p>
</blockquote>
<p>I don't know what <code>const_evaluatable_checked</code> is</p>



<a name="235364636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364636">(Apr 20 2021 at 15:33)</a>:</h4>
<p>an unstable feature <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="235364643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364643">(Apr 20 2021 at 15:33)</a>:</h4>
<p>is that a query? :)</p>



<a name="235364652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364652">(Apr 20 2021 at 15:33)</a>:</h4>
<p>oh, ok</p>



<a name="235364672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364672">(Apr 20 2021 at 15:33)</a>:</h4>
<p>so it compares the 'program text', so to speak</p>



<a name="235364742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364742">(Apr 20 2021 at 15:34)</a>:</h4>
<p>ignoring whitespace ^^ yes</p>



<a name="235364819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364819">(Apr 20 2021 at 15:34)</a>:</h4>
<p>OK.</p>



<a name="235364833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364833">(Apr 20 2021 at 15:34)</a>:</h4>
<p>For the purposes of today, can we say that it compares the AST</p>



<a name="235364869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364869">(Apr 20 2021 at 15:35)</a>:</h4>
<p>for the purpose of today <span aria-label="rolling on the floor laughing" class="emoji emoji-1f923" role="img" title="rolling on the floor laughing">:rolling_on_the_floor_laughing:</span></p>



<a name="235364870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364870">(Apr 20 2021 at 15:35)</a>:</h4>
<p>I'd like to sidestep questions about MIR and the fidelity of that lowering process for a moment :)</p>



<a name="235364936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235364936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235364936">(Apr 20 2021 at 15:35)</a>:</h4>
<p>ok, carry on</p>



<a name="235365000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365000">(Apr 20 2021 at 15:35)</a>:</h4>
<p><code>split_first</code> can, and will, be used in a lot of places where <code>N - 1</code> is never mentioned in the public signature</p>



<a name="235365169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365169">(Apr 20 2021 at 15:36)</a>:</h4>
<p>so stuff like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">some_method</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="p">(</span><span class="n">first</span><span class="p">,</span><span class="w"> </span><span class="n">rest</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">split_first</span><span class="p">(</span><span class="n">arr</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">rest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235365270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365270">(Apr 20 2021 at 15:37)</a>:</h4>
<p>here it is not apparent that <code>some_method</code> tries to evaluate <code>N - 1</code> at any point</p>



<a name="235365296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365296">(Apr 20 2021 at 15:37)</a>:</h4>
<p>without looking into <code>some_method</code></p>



<a name="235365390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365390">(Apr 20 2021 at 15:38)</a>:</h4>
<p>sure</p>



<a name="235365514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365514">(Apr 20 2021 at 15:38)</a>:</h4>
<p>and of course <code>[u8; 0]</code> would be bad</p>



<a name="235365553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365553">(Apr 20 2021 at 15:38)</a>:</h4>
<p>post monomorphization errors when using <code>some_method::&lt;0&gt;</code> are bad</p>



<a name="235365572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365572">(Apr 20 2021 at 15:39)</a>:</h4>
<p>that is the point where I may not agree :)</p>



<a name="235365589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365589">(Apr 20 2021 at 15:39)</a>:</h4>
<p>well, I agree they are bad</p>



<a name="235365611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365611">(Apr 20 2021 at 15:39)</a>:</h4>
<p>because we can't really track where <code>N</code> is coming from during mono item collection</p>



<a name="235365617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365617">(Apr 20 2021 at 15:39)</a>:</h4>
<p>just not convinced yet the cure is worse than the disease, as they say</p>



<a name="235365762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365762">(Apr 20 2021 at 15:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235365611">said</a>:</p>
<blockquote>
<p>because we can't really track where <code>N</code> is coming from during mono item collection</p>
</blockquote>
<p>this is an interesting consideration, although I think not a given</p>



<a name="235365817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365817">(Apr 20 2021 at 15:40)</a>:</h4>
<p>now, the cure:</p>



<a name="235365840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365840">(Apr 20 2021 at 15:40)</a>:</h4>
<p>I think maybe it doesn't seem like such a huge problem when everything is in one codebase, but is much worse when it's hidden deep in some library code.</p>



<a name="235365861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365861">(Apr 20 2021 at 15:40)</a>:</h4>
<ul>
<li>optionally allow the user to specify const evaluatable bounds</li>
</ul>



<a name="235365934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235365934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235365934">(Apr 20 2021 at 15:41)</a>:</h4>
<p>It doesn't seem worse than a function like </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="p">[</span><span class="kt">u8</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="p">(</span><span class="n">head</span><span class="p">,</span><span class="w"> </span><span class="n">tail</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="p">.</span><span class="n">split_first</span><span class="p">();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>which may panic</p>



<a name="235366008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366008">(Apr 20 2021 at 15:41)</a>:</h4>
<p>yeah, but you won't use <code>split_first</code> like this, will you? <em>edit: with doc comment I might</em> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="235366031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366031">(Apr 20 2021 at 15:41)</a>:</h4>
<p>I would, sure</p>



<a name="235366092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366092">(Apr 20 2021 at 15:42)</a>:</h4>
<p>I mean I'd probably have a comment -- or at least an understanding -- that the slice is known to be non-empty</p>



<a name="235366137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366137">(Apr 20 2021 at 15:42)</a>:</h4>
<p>I think in practice you will have many functions with the same property</p>



<a name="235366214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366214">(Apr 20 2021 at 15:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235365861">said</a>:</p>
<blockquote>
<ul>
<li>optionally allow the user to specify const evaluatable bounds</li>
</ul>
</blockquote>
<p>but let's walk through this</p>



<a name="235366317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366317">(Apr 20 2021 at 15:43)</a>:</h4>
<p>I will say also that</p>



<a name="235366427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366427">(Apr 20 2021 at 15:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235365861">said</a>:</p>
<blockquote>
<ul>
<li>optionally allow the user to specify const evaluatable bounds</li>
</ul>
</blockquote>
<p>i did argue for this from a slightly wrong angle</p>



<a name="235366432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366432">(Apr 20 2021 at 15:44)</a>:</h4>
<p>at the moment I'm seeing a bit of "binary" -- either we take monomorphization errors <em>or</em> we propagate these bounds that I suspect will be a common source of confusion. And maybe there is no other path, but it may be that if we poke enough, we'll find one.</p>



<a name="235366488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366488">(Apr 20 2021 at 15:44)</a>:</h4>
<p>ignoring the above issues, I do think that optional const evaluatable bounds are useful</p>



<a name="235366497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366497">(Apr 20 2021 at 15:44)</a>:</h4>
<p>(this would kind of be the shiny future process :) trying to spell out the whole experience and worry less about the engineering challenges for the moment)</p>



<a name="235366517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366517">(Apr 20 2021 at 15:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235366488">said</a>:</p>
<blockquote>
<p>ignoring the above issues, I do think that optional const evaluatable bounds are useful</p>
</blockquote>
<p><em>optional</em> bounds -- maybe so</p>



<a name="235366540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366540">(Apr 20 2021 at 15:44)</a>:</h4>
<p>I might love to have, for example, something like</p>



<a name="235366579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366579">(Apr 20 2021 at 15:45)</a>:</h4>
<p>a lint that suggests a <code>where {N &gt; 0}</code> bound</p>



<a name="235366594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366594">(Apr 20 2021 at 15:45)</a>:</h4>
<p>like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">struct</span> <span class="nc">EncryptionStuff</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">P</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="p">(</span><span class="n">is_prime</span><span class="p">(</span><span class="n">P</span><span class="p">))</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="235366643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366643">(Apr 20 2021 at 15:45)</a>:</h4>
<p>and says "clients of <code>split_first</code> may fail at monomorphization time, maybe add this where clause"</p>



<a name="235366665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366665">(Apr 20 2021 at 15:45)</a>:</h4>
<p>and it propagates around</p>



<a name="235366667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366667">(Apr 20 2021 at 15:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235366432">said</a>:</p>
<blockquote>
<p>at the moment I'm seeing a bit of "binary" -- either we take monomorphization errors <em>or</em> we propagate these bounds that I suspect will be a common source of confusion. And maybe there is no other path, but it may be that if we poke enough, we'll find one.</p>
</blockquote>
<p>I think it'll be easy enough to make descriptive diagnostics for these bounds that will ameliorate most of the potential confusion.</p>



<a name="235366739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366739">(Apr 20 2021 at 15:46)</a>:</h4>
<p>maybe. Let's write the stories then :)</p>



<a name="235366790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366790">(Apr 20 2021 at 15:46)</a>:</h4>
<p>I guess that I think that things like <code>N-1</code> are going to be pretty common, and if one has to add explicit where clauses every time... idk.</p>



<a name="235366818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366818">(Apr 20 2021 at 15:46)</a>:</h4>
<p>when like 99% of the time the fn is getting invokved with 3 values, none of which are even close to 0</p>



<a name="235366872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366872">(Apr 20 2021 at 15:46)</a>:</h4>
<p>esp. given that the end result is a failure to <em>build</em>, not an obscure bug</p>



<a name="235366948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235366948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235366948">(Apr 20 2021 at 15:47)</a>:</h4>
<p>I do agree though that post-monomorphization errors leading to obscure inability to link together crates sucks</p>



<a name="235367129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235367129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235367129">(Apr 20 2021 at 15:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235366488">said</a>:</p>
<blockquote>
<p>ignoring the above issues, I do think that optional const evaluatable bounds are useful</p>
</blockquote>
<p>and making them opt-out instead of opt-in seems favorable to me, esp because i dislike using lints for something like this</p>



<a name="235367509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235367509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235367509">(Apr 20 2021 at 15:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235366739">said</a>:</p>
<blockquote>
<p>maybe. Let's write the stories then :)</p>
</blockquote>
<p>taking the 3 characters from asnyc stories?</p>



<a name="235367760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235367760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235367760">(Apr 20 2021 at 15:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235366432">said</a>:</p>
<blockquote>
<p>at the moment I'm seeing a bit of "binary" -- either we take monomorphization errors <em>or</em> we propagate these bounds that I suspect will be a common source of confusion. And maybe there is no other path, but it may be that if we poke enough, we'll find one.</p>
</blockquote>
<p>yeah, because arguing against actually usable alternatives is more difficult :p</p>



<a name="235367907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235367907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235367907">(Apr 20 2021 at 15:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235367129">said</a>:</p>
<blockquote>
<p>and making them opt-out instead of opt-in seems favorable to me, esp because i dislike using lints for something like this</p>
</blockquote>
<p>why do you dislike using lints for this?</p>



<a name="235368195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368195">(Apr 20 2021 at 15:55)</a>:</h4>
<p>I've been somewhat leaning towards "allow-by-default" lints as a reasonable way for folks to get "more guarantees than make sense by default'</p>



<a name="235368216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368216">(Apr 20 2021 at 15:55)</a>:</h4>
<p>might be a useful group</p>



<a name="235368249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368249">(Apr 20 2021 at 15:55)</a>:</h4>
<p>(I suppose the "no explicit bounds" approach is really the same as implied bounds for const generics, where the original bounds are implicitly induced by code itself, and from this perspective, it can seem less harmful.)</p>



<a name="235368262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368262">(Apr 20 2021 at 15:56)</a>:</h4>
<p>To me this is very similar to the "assertpanicsafe" thing. We don't just allow you to use everything and lint, instead we error and require wrapping in the escape hatch wrapper type</p>



<a name="235368344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368344">(Apr 20 2021 at 15:56)</a>:</h4>
<p>there's a few differences</p>



<a name="235368565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368565">(Apr 20 2021 at 15:57)</a>:</h4>
<p>Right, this is not unsound, just horrible UX which we should work on improving anyway</p>



<a name="235368621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368621">(Apr 20 2021 at 15:58)</a>:</h4>
<p>but also:</p>



<a name="235368667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368667">(Apr 20 2021 at 15:58)</a>:</h4>
<p><del>assert panic safe is also not unsound</del></p>



<a name="235368737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368737">(Apr 20 2021 at 15:58)</a>:</h4>
<p>we have traditionally protected you against panic unsafety <em>at the resolution of Send + Sync</em></p>



<a name="235368757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368757">(Apr 20 2021 at 15:58)</a>:</h4>
<p>that's oddly stated</p>



<a name="235368772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368772">(Apr 20 2021 at 15:59)</a>:</h4>
<p>what I mean is:</p>



<a name="235368831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235368831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235368831">(Apr 20 2021 at 15:59)</a>:</h4>
<p>when we introduced <code>assert_unwind_safe</code></p>



<a name="235369250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369250">(Apr 20 2021 at 16:01)</a>:</h4>
<p>(sorry, got a phone call)</p>



<a name="235369268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369268">(Apr 20 2021 at 16:01)</a>:</h4>
<p>when we introduced <code>catch-unwind</code>, I mean</p>



<a name="235369290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369290">(Apr 20 2021 at 16:01)</a>:</h4>
<p>we had previously guaranteed that panics would tear down the entire thread</p>



<a name="235369354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369354">(Apr 20 2021 at 16:02)</a>:</h4>
<p>so effectively the only data that could be witnessed in an incomplete state was data that was <code>Send + Sync</code>, and even that was a bit challenging</p>



<a name="235369525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369525">(Apr 20 2021 at 16:02)</a>:</h4>
<p>the premise of <code>AssertUnwindSafe</code> (which I supported and still appreciate myself, but which I think is also a regular irritant for folks and not a clear win overall) was that we were going to preserve this guarantee and not make it super easy to drop</p>



<a name="235369567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369567">(Apr 20 2021 at 16:03)</a>:</h4>
<p>but we don't guarantee anything about integer overflow right now</p>



<a name="235369603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369603">(Apr 20 2021 at 16:03)</a>:</h4>
<p>we will panic in debug mode</p>



<a name="235369658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369658">(Apr 20 2021 at 16:03)</a>:</h4>
<p>which seems to me to be strictly more painful to track than a monomorphization failure</p>



<a name="235369756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369756">(Apr 20 2021 at 16:04)</a>:</h4>
<p>That isn't true. A panic gives you a backtrace</p>



<a name="235369764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369764">(Apr 20 2021 at 16:04)</a>:</h4>
<p>as the latter is deterministic-- of cours I'm assuming we do a good job giving you a backtrace etc</p>



<a name="235369802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369802">(Apr 20 2021 at 16:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235369756">said</a>:</p>
<blockquote>
<p>That isn't true. A panic gives you a backtrace</p>
</blockquote>
<p>I don't accept that we can't do that</p>



<a name="235369814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369814">(Apr 20 2021 at 16:04)</a>:</h4>
<p>that feels like an impl hurdle</p>



<a name="235369818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369818">(Apr 20 2021 at 16:04)</a>:</h4>
<p>A post mono error can be many levels disconnected from the root</p>



<a name="235369880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369880">(Apr 20 2021 at 16:04)</a>:</h4>
<p>let's hypothesize for a moment that we <em>could</em> give you a backtrace</p>



<a name="235369916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369916">(Apr 20 2021 at 16:05)</a>:</h4>
<p>Ok</p>



<a name="235369920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369920">(Apr 20 2021 at 16:05)</a>:</h4>
<p>so that the monomorphization error were formatted in roughly the same way as the panic</p>



<a name="235369932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369932">(Apr 20 2021 at 16:05)</a>:</h4>
<p>does that change the calculus for you?</p>



<a name="235369973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235369973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235369973">(Apr 20 2021 at 16:05)</a>:</h4>
<p>A bit</p>



<a name="235370051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370051">(Apr 20 2021 at 16:05)</a>:</h4>
<p>I just have had hammered in that mono-time errors are bad and am parroting that</p>



<a name="235370153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370153">(Apr 20 2021 at 16:06)</a>:</h4>
<p>I mean they are :)</p>



<a name="235370163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370163">(Apr 20 2021 at 16:06)</a>:</h4>
<p>I don't know if I ever built a strong opinion about them other than that they are annoying</p>



<a name="235370239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370239">(Apr 20 2021 at 16:07)</a>:</h4>
<p>And that we don't see them in check builds</p>



<a name="235370245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370245">(Apr 20 2021 at 16:07)</a>:</h4>
<p>it's just that having people hand propagate a lot of where clauses around feels like it could get pretty annoying too</p>



<a name="235370298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370298">(Apr 20 2021 at 16:07)</a>:</h4>
<p>(I am not claiming it's clear cut)</p>



<a name="235370391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370391">(Apr 20 2021 at 16:08)</a>:</h4>
<p>Right. If we auto-bubble, that makes body changes a breaking change though i think?</p>



<a name="235370416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370416">(Apr 20 2021 at 16:08)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> regarding stories, maybe we can actually spin up a vision doc? I'd use the same characters, yes, but I don't think that's the high-order bit here.</p>



<a name="235370498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370498">(Apr 20 2021 at 16:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235370391">said</a>:</p>
<blockquote>
<p>Right. If we auto-bubble, that makes body changes a breaking change though i think?</p>
</blockquote>
<p>it does, I agree that's part of the equation. Of course, they already are, at least if they affect the return value.</p>



<a name="235370570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370570">(Apr 20 2021 at 16:09)</a>:</h4>
<p>but in the same way that one can write a binary search that isn't careful about overflow</p>



<a name="235370576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370576">(Apr 20 2021 at 16:09)</a>:</h4>
<p>and get wrong results</p>



<a name="235370577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370577">(Apr 20 2021 at 16:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235367907">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235367129">said</a>:</p>
<blockquote>
<p>and making them opt-out instead of opt-in seems favorable to me, esp because i dislike using lints for something like this</p>
</blockquote>
<p>why do you dislike using lints for this?</p>
</blockquote>
<p>because i do '^^, after thinking about it, the reason theses to be that lints often can be ignored/misunderstood and globally disabled, even if they would be useful</p>



<a name="235370636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370636">(Apr 20 2021 at 16:09)</a>:</h4>
<p>i don't know how strong that argument actually is</p>



<a name="235370710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370710">(Apr 20 2021 at 16:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235370498">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235370391">said</a>:</p>
<blockquote>
<p>Right. If we auto-bubble, that makes body changes a breaking change though i think?</p>
</blockquote>
<p>it does, I agree that's part of the equation. Of course, they already are, at least if they affect the return value.</p>
</blockquote>
<p>You mean if it affects the type of the return value? Users are already familiar with changing types in signatures being breaking changes; also having body changes being breaking is something new to deal with.</p>



<a name="235370836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370836">(Apr 20 2021 at 16:10)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235370416">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> regarding stories, maybe we can actually spin up a vision doc? I'd use the same characters, yes, but I don't think that's the high-order bit here.</p>
</blockquote>
<p>^^ never wrote anything like that, do you have any references?</p>



<a name="235370876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370876">(Apr 20 2021 at 16:11)</a>:</h4>
<p>I mean if you change the algorithm without changing the behaviour. If that changed the constants being evaluated, you got a breaking change</p>



<a name="235370903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370903">(Apr 20 2021 at 16:11)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> I'd be happy to spend an hour with you getting it started</p>



<a name="235370933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370933">(Apr 20 2021 at 16:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235370876">said</a>:</p>
<blockquote>
<p>I mean if you change the algorithm without changing the behaviour. If that changed the constants being evaluated, you got a breaking change</p>
</blockquote>
<p>yes -- but this is true today is my point</p>



<a name="235370948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370948">(Apr 20 2021 at 16:11)</a>:</h4>
<p>at runtime, no less</p>



<a name="235370994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235370994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235370994">(Apr 20 2021 at 16:11)</a>:</h4>
<p>compare;</p>



<a name="235371006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371006">(Apr 20 2021 at 16:11)</a>:</h4>
<p>Right...</p>



<a name="235371038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371038">(Apr 20 2021 at 16:12)</a>:</h4>
<p>(copying from <a href="https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html">this blogpost</a>)</p>



<a name="235371177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371177">(Apr 20 2021 at 16:12)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="w"> </span><span class="p">[</span><span class="kt">u32</span><span class="p">]</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">binary_search</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">key</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="o">..</span><span class="p">.</span><span class="w"></span>
<span class="w">        </span><span class="k">while</span><span class="w"> </span><span class="n">low</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="n">high</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">mid</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">low</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">high</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">2</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="o">..</span><span class="p">.</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235371190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371190">(Apr 20 2021 at 16:12)</a>:</h4>
<p>vs</p>



<a name="235371197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371197">(Apr 20 2021 at 16:12)</a>:</h4>
<p>One more data point: const evaluatabe checked is exactly what the typenum crate requires. Because types are actually checked for trait bounds and stuff</p>



<a name="235371204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371204">(Apr 20 2021 at 16:12)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="n">mid</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">low</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="p">((</span><span class="n">high</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">low</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">2</span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="235371219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371219">(Apr 20 2021 at 16:13)</a>:</h4>
<p>equivalent, but not equivalent</p>



<a name="235371266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371266">(Apr 20 2021 at 16:13)</a>:</h4>
<p>well, ok, because <code>usize</code> maybe not</p>



<a name="235371369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371369">(Apr 20 2021 at 16:14)</a>:</h4>
<p>If we do some sort of auto inference of const bounds, then that diverges from what we do in types and trait bounds</p>



<a name="235371384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371384">(Apr 20 2021 at 16:14)</a>:</h4>
<p>but anyway you get the point :)</p>



<a name="235371411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371411">(Apr 20 2021 at 16:14)</a>:</h4>
<p>I do</p>



<a name="235371551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371551">(Apr 20 2021 at 16:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/260443-project-const-generics/topic/meeting.202021-04-20/near/235371369">said</a>:</p>
<blockquote>
<p>If we do some sort of auto inference of const bounds, then that diverges from what we do in types and trait bounds</p>
</blockquote>
<p>I definitely think we should try to be consistent -- implied bounds has a role here</p>



<a name="235371886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371886">(Apr 20 2021 at 16:17)</a>:</h4>
<p>An approach between the two extremes could be to require explicit bounds on the original function, but also have implied bounds for const parameters. Then changing the body doesn't unexpectedly change the type, but it avoids always having to manually annotate bounds throughout the call stack.<br>
(I'm not sure whether this would be an improvement in practice or not.)</p>



<a name="235371889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371889">(Apr 20 2021 at 16:17)</a>:</h4>
<p>I think my overall feeling is that Rust is used for a great many things. I'm casting about for ways that we can give a "gradual, controllable" balance between verbosity and correctness. I'm interested in FV and other tools for this reason. It seems to apply here, too.</p>



<a name="235371928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371928">(Apr 20 2021 at 16:17)</a>:</h4>
<p>what is "FV"?</p>



<a name="235371943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371943">(Apr 20 2021 at 16:17)</a>:</h4>
<p>(formal verification)</p>



<a name="235371954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235371954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235371954">(Apr 20 2021 at 16:17)</a>:</h4>
<p>ah thank you</p>



<a name="235372063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372063">(Apr 20 2021 at 16:18)</a>:</h4>
<p>Anyway, I do think it's time for us to start talking about what the end-user state of const generics is going to look and feel like-- <span class="user-mention" data-user-id="216206">@lcnr</span> maybe we could use next week's meeting to work on that?</p>



<a name="235372104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372104">(Apr 20 2021 at 16:18)</a>:</h4>
<p>I suspect it'll be hard for me to squeeze an hour this week, though not impossible</p>



<a name="235372217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372217">(Apr 20 2021 at 16:19)</a>:</h4>
<p>using next weeks meeting seems fine, though I also still need your time to talk about making <code>Sized</code> coinductive ^^</p>



<a name="235372264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372264">(Apr 20 2021 at 16:19)</a>:</h4>
<p>(the <code>Sized</code> thing doesn't really have any time constraints though)</p>



<a name="235372279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372279">(Apr 20 2021 at 16:19)</a>:</h4>
<p>we could use some of the "wg-traits office hours" to discuss that perhaps</p>



<a name="235372869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372869">(Apr 20 2021 at 16:23)</a>:</h4>
<p>sure, i should be available for these slots</p>



<a name="235372976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235372976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235372976">(Apr 20 2021 at 16:24)</a>:</h4>
<p>so yeah, let's talk a bit more about our goals for const generics in the next meetings</p>



<a name="235389010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235389010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235389010">(Apr 20 2021 at 18:10)</a>:</h4>
<p>from a private chat with <span class="user-mention silent" data-user-id="326176">Boxy</span> with their permission:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"></span>
<span class="k">where</span><span class="w"> </span><span class="n">assume</span><span class="p">(</span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="cm">/* .. */</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">split_first</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="p">(</span><span class="n">arr</span>: <span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="p">])</span><span class="w"> </span>-&gt; <span class="p">(</span><span class="n">T</span><span class="p">,</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">])</span><span class="w"></span>
<span class="k">where</span><span class="w"> </span><span class="n">evaluates</span><span class="p">(</span><span class="n">N</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">   </span><span class="cm">/* .. */</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>so both opt out and opt in is explicit, this does seem quite nice to me tbh and is an alternative i didn't consider yet</p>



<a name="235389225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235389225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235389225">(Apr 20 2021 at 18:12)</a>:</h4>
<p>i do think that if we get good enough error messages using a lint might be good enough, but i don't want to do that without some significant improvements on these errors</p>



<a name="235394316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235394316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235394316">(Apr 20 2021 at 18:44)</a>:</h4>
<p>I have an idea for how to create a backtrace for post monomorphization errors. It's not great, but better than the status quo: in the monomorphization collector, we already have that stack available, we just can't feed it into any queries or whatever is producing errors. So we wrap all possibly erroring calls with something that checks the error count before and after the call. If the count went up, print the stack mentioning that the last error occurred at this monomorphization stack. To reduce the noise, only do that if the current item is generic</p>



<a name="235394387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/260443-project-const-generics/topic/meeting%202021-04-20/near/235394387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/260443-project-const-generics/topic/meeting.202021-04-20.html#235394387">(Apr 20 2021 at 18:44)</a>:</h4>
<p>It's pretty low effort to implement that, gives immediate gains and isn't worse than the current situation</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>